package com.edu.servlet;

import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.edu.bean.Cardetails;
import com.edu.service.CardetailsService;
import com.edu.service.impl.CardetailsServiceImpl;
@WebServlet("/updatecardetail.do")
public class UpdateCardetailsServlet extends HttpServlet{
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		CardetailsService cs = new CardetailsServiceImpl();
		String id = req.getParameter("id");
		String cid = req.getParameter("carid");
		String introduce = req.getParameter("introduce");
		String engine = req.getParameter("engine");
		String carkw = req.getParameter("carkw");
		String torque = req.getParameter("torque");
		String accel = req.getParameter("accel");
		String drivingmode = req.getParameter("drivingmode");
		String mph = req.getParameter("mph");
		int cardetail = Integer.parseInt(id);
		int carid = Integer.parseInt(cid);
		Cardetails cdls = new Cardetails(cardetail,carid,introduce,engine,carkw,torque,accel,drivingmode,mph);
		cs.updateCardetails(cdls);
	}
}
